<?php

// Init owncloud

require_once(OC_App::getAppPath('resumes') . "/lib/tag.php");

$LoginStats = PUtil::checkUserLogin(true);
if ($LoginStats !== true) {
   echo $LoginStats;
   exit();
}

OCP\JSON::callCheck();

$jobid = JRequest::getInt('jobid', 0);
$tagid = JRequest::getInt('tagid', 0);
$resumeid = JRequest::getInt('resumeid', 0);

$model = new PResumesModelTag();

if (!$model->removeResumeTag($jobid, $resumeid, $tagid)) {
   OCP\JSON::error(array('error' => $model->getError()));
} else {
   OCP\JSON::success();
}
